import java.util.*;

public class Test {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.nextLine();
        char[] s = str.toCharArray();
        int[] dp = new int[s.length + 1];

        dp[0] = 1;
        dp[1]=(s[0]-'0'!=0)?1:0;
            for (int i = 2; i <= s.length; i++) {
                if (s[i-1] - '0' != 0) dp[i] += dp[i - 1];
                int tt = (s[i - 2] - '0') * 10 + (s[i-1] - '0');
                if (tt >= 10 && tt <= 26) dp[i] += dp[i - 2];
            }
            System.out.println(dp[s.length]);
        }

    public static void main4(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String str=scanner.nextLine();
        char[] s=str.toCharArray();
        int[] dp=new int[s.length];
        if(s[0]-'0'!=0) dp[0]+=1;
        if(s.length==1) {
            System.out.println(dp[0]);
            return;
        }
        if(s[1]-'0'!=0) dp[1]+=dp[0];
        int t=(s[1-1]-'0')*10+(s[1]-'0');
        if(t>=10&&t<=26) dp[1]+=1;

        for(int i=2;i<s.length;i++){
            if(s[i]-'0'!=0) dp[i]+=dp[i-1];
            int tt=(s[i-1]-'0')*10+(s[i]-'0');
            if(tt>=10&&tt<=26) dp[i]+=dp[i-2];
        }
        System.out.println(dp[s.length-1]);
    }

    public static void main3(String[] args) {
        Scanner scanner=new Scanner(System.in);
         int n=scanner.nextInt();
        int[] cost=new int[n];
        for(int i=0;i<n;i++){
            cost[i]=scanner.nextInt();
        }
        int[] dp=new int[n+1];
        dp[n-1]=cost[n-1];
        dp[n-2]=cost[n-2];
        for(int i=n-3;i>=0;i--){
            dp[i]=Math.min(dp[i+1]+cost[i],dp[i+2]+cost[i]);
        }
        System.out.println(dp[0]>=dp[1]?dp[1]:dp[0]);

    }
    public static void main2(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[] cost=new int[n];
        for(int i=0;i<n;i++){
            cost[i]=scanner.nextInt();
        }
        int[] dp=new int[n+1];
        for(int i=2;i<=n;i++){
            dp[i]=Math.min(dp[i-1]+cost[i-1],dp[i-2]+cost[i-2]);
        }
        System.out.println(dp[n]);
    }

    public static void main1(String[] args) {
        Scanner scanner=new Scanner(System.in);
        String str=scanner.nextLine();
        int left=0;
        int right=1;
        if(str.length()==0) System.out.println(0);
        if(str.length()==1) System.out.println(1);
        HashSet<Character> hashSet=new HashSet<>();
        hashSet.add(str.charAt(0));
        int length=1;
        while (right!=str.length()){
            while (right!=str.length()&&!hashSet.contains(str.charAt(right))){
                hashSet.add(str.charAt(right));
                right++;
            }
            length=right-left>length?right-left:length;
            if(right!=str.length()) hashSet.remove(str.charAt(left));
            left++;
        }
        System.out.println(length);
    }
}
